<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        span{
            color: red;
        }
    </style>
</head>
<body>
    <div>
        <input type="text" name="" id="num1"> VS
        <input type="text" name="" id="num2">
        <button id="btn">最大的数是>>></button>
        <span id="span"></span>
    </div>
    <script>
        window.onload = function(){
            var num1 = document.getElementById('num1')
            var num2 = document.getElementById('num2')
            var btn = document.getElementById('btn')
            var span = document.getElementById('span')

            btn.onclick = function(){
                if(num1.value > num2.value){
                    span.innerText = num1.value
                }else{
                    span.innerText = num2.value
                }
            }
        }
    </script>
</body>
</html>